import 'package:city_corner/main-page/filter-panel/local-panel/subway/subway-data.dart';
import 'package:flutter/cupertino.dart';

import '../../opt-list.dart';

class SubWay extends StatefulWidget {
  @override
  _SubWayState createState() => _SubWayState();
}

class _SubWayState extends State<SubWay> {
  List subwayOpts = [];

  @override
  initState() {
    super.initState();
    initSubwayOpts();
  }

  void initSubwayOpts() {
    Map subwayList = subwayData[440100];
    List _subwayOpts = [
      {'label': '不限', 'value': 0}
    ];
    subwayList.forEach((key, value) {
      _subwayOpts.add({'label': key.toString() + '号线', 'value': key});
    });
    setState(() {
      subwayOpts = _subwayOpts;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Container(child: OptList(opts: subwayOpts));
  }
}
